#include "py/runtime.h"

extern int led_set_blink(int led, int sec, int freq);

static mp_obj_t addi(mp_obj_t a_obj, mp_obj_t b_obj)
{
    int a = mp_obj_get_int(a_obj);
    int b = mp_obj_get_int(b_obj);

    led_set_blink(0, a, b);

    return mp_obj_new_int(a + b);
}
STATIC MP_DEFINE_CONST_FUN_OBJ_2(addi_obj, addi);

STATIC const mp_rom_map_elem_t globals_table[] = {
    { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_test1) },
    { MP_ROM_QSTR(MP_QSTR_addi), MP_ROM_PTR(&addi_obj) },
};
STATIC MP_DEFINE_CONST_DICT (module_globals, globals_table);

const mp_obj_module_t test1_module = {
    .base = { &mp_type_module },
    .globals = (mp_obj_dict_t*)&module_globals,
};
